# -*- coding: utf-8 -*-
# @Time    : 2021/7/7 14:46
# @Author  : LuoTianHang

# ####################datalist.py 说明##########################
# this script is used for the train.py to prepare the data


from PIL import Image
from torchvision import transforms

imsize = 512

transform = transforms.Compose([
    transforms.Resize(512),
    transforms.CenterCrop(imsize),
    transforms.ToTensor()])


def image_loader(image_name):
    image = Image.open(image_name)
    image = image.convert('RGB')
    image = transform(image).unsqueeze(0)
    return image.cuda()
